//
//  UIBarButtonItem-Extension.swift
//  WeiBoSwift
//
//  Created by 吴斌 on 2022/9/22.
//

import UIKit

// MARK: - UIBarButtonItem扩展构造方法
extension UIBarButtonItem {
    convenience init(imageName: String) {
        self.init()
        
        let btn = UIButton()
        btn.setImage(UIImage(named: imageName), for: .normal)
        btn.setImage(UIImage(named: imageName + "_selected"), for: .highlighted)
        btn.sizeToFit()
        
        customView = btn
    }
}
